package cn.tedu._03vehicle.pojo.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Data;
import lombok.NonNull;

@Data
public class UserRegParam {
    //@NotNull(message = "用户名不能为null")
    //@NotEmpty(message = "用户名不能为null和空字符串")
    //@NotBlank(message = "用户名不能为null和空字符串和空白串")
    //@Size(min = 5,max = 8,message = "用户名必须在5到8位之间")
    @Pattern(regexp = "[\\u4e00-\\u9fa5]{1,7}|[a-zA-Z]{1,14}",message = "用户名不能超过7个汉字或14个英文字符")
    @Schema(description = "用户名", required = true)
    private String username;
    @Schema(description = "密码", required = true)
    @Pattern(regexp = "^(?!.*[\\s\\u4e00-\\u9fa5])(?=.*[a-zA-Z\\u00a1-\\uffff])(?=.*[\\d\\u00a1-\\uffff])[a-zA-Z\\d\\u00a1-\\uffff]{8,14}$|^(?!.*[\\s\\u4e00-\\u9fa5])(?=.*[a-zA-Z\\u00a1-\\uffff])(?=.*[\\p{P}\\p{S}])[a-zA-Z\\p{P}\\p{S}]{8,14}$|^(?!.*[\\s\\u4e00-\\u9fa5])(?=.*[\\d\\u00a1-\\uffff])(?=.*[\\p{P}\\p{S}])[\\d\\p{P}\\p{S}]{8,14}$", message = "密码长度位8-14个字符...")
    private String password;
    @Email(message = "邮箱格式不合法")
    @Schema(description = "电子邮箱", required = true)
    private String email;
    @Schema(description = "手机号", required = true)
    private String phone;
}
